package digui;

public class Fibo4 {
    static int fibo4(int n){
        if (n <= 2) return 1;
        int first = 1;
        int second = 1;
        for (int i = 3; i <= n; i++) {
            second = first + second;
            first = second - first;
        }
        return second;
    }



    public static void main(String[] args) {
        System.out.println(fibo4(3));
        System.out.println(fibo4(4));
        System.out.println(fibo4(5));
        System.out.println(fibo4(6));
        System.out.println(fibo4(7));
        System.out.println(fibo4(8));
    }
}
